// pages/activity/activity.js
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		http: getApp().globalData.map,
		tjr: ''
	},

	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad: function(options) {
		wx.request({
			url: getApp().globalData.http + 'action=newIndex',
			success: (e) => {
				console.log(e)
				if (e.data.code == 1) {
					this.setData({
						title: e.data.data
					})
					wx.setNavigationBarTitle({
					  title: e.data.data.ruzhuPic[0].title
					})
				}
			}
		})
		if (options.tjr != undefined) {
			wx.setStorage({
				key: 'tjrid',
				data: options.tjrid
			})
			this.setData({
				tjr:options.tjrid
			})
		}
		wx.request({
			url: getApp().globalData.http + 'action=getwnzb',
			success: (e) => {
				console.log(e)
				this.setData({
					data: e.data.data
				})
			}
		})
		wx.getStorage({
			key: 'uid',
			success: (e) => {
				this.setData({
					uid: e.data
				})
			}
		})
	},
	onShareAppMessage: function(options) {
		return {
			title: this.data.title.ruzhuPic[0].title,
			desc: '分享页面的内容',
			path: '/pages/activity/activity?&tjr=' + this.data.uid.uid // 路径，传递参数到指定页面。
		}
	},
})
